/*1207 ldz*/
var _LOAD_SCRIPT_ = function(a, c) {
    if (!a) {
        return;
    }
    if (!c) {
        _LOAD_SCRIPT_DELAY_(a);
        return;
    }
    var b = document.createElement("script");
    b.type = "text/javascript";
    b.async = true;
    b.src = a;
    setTimeout(function() {
        document.getElementsByTagName("head")[0].appendChild(b);
    },
    0);
};
var _G_SCRIPT_lIST_ = [];
var _LOAD_SCRIPT_DELAY_ = function(a) {
    _G_SCRIPT_lIST_[_G_SCRIPT_lIST_.length] = a;
};
var _RUNNING_LOAD_SCRIPT_ = function() {
    if (_G_SCRIPT_lIST_ && _G_SCRIPT_lIST_.length > 0) {
        for (var a = 0; a < _G_SCRIPT_lIST_.length; a++) {
            _LOAD_SCRIPT_(_G_SCRIPT_lIST_[a], true);
        }
    }
};
if (document.attachEvent) {
    window.attachEvent("onload",
    function() {
        _RUNNING_LOAD_SCRIPT_();
    });
} else {
    window.addEventListener("load",
    function(a) {
        _RUNNING_LOAD_SCRIPT_();
    },
    false);
}
function _LOAD_VIRTUAL_FUNCTION_(b, a) {
    if (!a) {
        window[b] = function() {};
    } else {
        window[b] = function() {
            return a;
        };
    }
}
function reSortDom(e, c) {
    if (!e || !e.length) {
        return [];
    }
    var f = [];
    for (var a = 0,
    d = e.length; a < d; a++) {
        if (e[a].nodeName == "#text" || e[a].nodeName == "#comment") {
            continue;
        }
        f.push([e[a], e[a].innerHTML]);
    }
    if (f.length > (c ? 0 : 1)) {
        var b = f[0][0].parentNode;
        if (b.tagName.toLowerCase() == "tr" || b.tagName.toLowerCase() == "table") {
            return;
        }
        f = f.sort(function() {
            return Math.random() - 0.5;
        });
        b.innerHTML = "";
        for (var a = 0,
        d = f.length; a < d; a++) {
            if (typeof c == "string") {
                if (a == 0) {
                    M.addClass(f[a][0], c);
                }
            } else {
                if (typeof firstClassFit == "function") {
                    M.addClass(f[a][0], c(a));
                }
            }
            if (f[a][0].innerHTML == "") {
                f[a][0].innerHTML = f[a][1];
            }
            b.appendChild(f[a][0]);
        }
    }
    return f;
}
function _SET_CHAT_DATA_READY_(a) {
    window._MCHAT_DATA_READY_ = a;
    _INIT_CHAT_EXPR_();
}
function _INIT_CHAT_EXPR_() {
    if (!window._MCHAT_DOM_READY_ || !window._MCHAT_DATA_READY_) {
        return;
    }
    var c = M.$("#DY_chat_expr_box");
    if (!c) {
        return;
    }
    if (c.innerHTML == "") {
        c.innerHTML = window._MCHAT_DATA_READY_.html_content;
    }
    var b = M.$("#chat_f1_main");
    var a = reSortDom(c.childNodes);
    if (b && a.length) {
        M.Animate(b, {
            height: "160px"
        },
        300);
    }
    if (a.length) {
        M.Animate(c, {
            height: (26 * a.length) + "px"
        },
        300);
    }
}
function _SHOW_GOLDEN_ACCOUNT_BOX_(a) {
    if (a && a.html_content) {
        window._golden_ligntbox_box_ = M.lightBox(a.html_content, {},
        true);
    }
}
var M = {
    lightBox: function(l, n, f, o, c, p, a) {
        o = o || 300;
        var i = document.createElement("div");
        var m = new Date();
        var b = m.getTime().toString(36);
        m = "JS_lightBox_" + b;
        i.className = "lightBox " + (a ? a: "");
        i.id = m;
        if (c) {
            i.style.cssText = c;
        }
        i.style.zIndex = o;
        var j = '<div class="htmls">' + (l + "").replace(/{=id}/g, b) + "</div>";
        var e = "";
        for (var g in n) {
            e += '<button id="' + m + "_" + g + '">' + g + "</button>";
        }
        if (e) {
            e = '<div class="btns">' + e + "</div>";
        }
        j = f ? j + e: '<div class="in">' + j + e + "</div>";
        i.innerHTML = j;
        i._showMask = p;
        if (p) {
            M.showMask(o - 1);
        }
        document.body.appendChild(i);
        for (var g in n) {
            if (n[g] == "close") {
                document.getElementById(m + "_" + g).onclick = function() {
                    M.closeLightBox(m);
                };
            } else {
                if (typeof n[g] === "function") {
                    document.getElementById(m + "_" + g).onclick = n[g];
                }
            }
        }
        M.lightBoxId = m;
        M.lightBoxTempId = b;
        return i;
    },
    closeLightBox: function(b) {
        if (!b) {
            b = M.lightBoxId;
        }
        b = "JS_lightBox_" + ((b + "").replace("JS_lightBox_", ""));
        var a = M.$("#" + b);
        if (a) {
            if (a._showMask) {
                M.hideMask();
            }
            document.body.removeChild(a);
        }
    },
    showMask: function(c) {
        if (M.maskDom) {
            M.hideMask();
        }
        c = c || 290;
        var a = document.createElement("div"),
        b = (document.body.scrollHeight >= window.screen.availHeight) ? document.body.scrollHeight: window.screen.availHeight;
        a.id = "JS_mask";
        a.className = "c-mask";
        a.style.cssText = "height:" + b + "px;width:100%;position:absolute;background:#000;z-index:900;top:0;left:0;opacity:0.5;filter:alpha(opacity=50);z-index:" + c;
        document.body.appendChild(a);
        M.maskDom = a;
    },
    hideMask: function() {
        if (M.maskDom) {
            M.maskDom.parentNode.removeChild(M.maskDom);
            M.maskDom = null;
        }
    },
    goExpr: function(e, a, d, c) {
        if (!e) {
            return;
        }
        if (e == "index.html") {
            M.setCookie("curr_page_sn", "index", 5, "meilele.com");
            M.setCookie("region_id", 0, 5, "meilele.com");
            M.setCookie("region_name", "全国", 5, "meilele.com");
            if (d == 2) {
                location.href = "/expr.html";
            } else {
                location.href = "/";
            }
        } else {
            M.setCookie("curr_page_sn", 0, 5, "meilele.com");
            M.setCookie("region_id", a, 5, "meilele.com");
            if (c) {
                M.setCookie("region_name", c, 5, "meilele.com");
            } else {
                M.setCookie("region_name", "", -1, "meilele.com");
            }
            if (d == 1) {
                location.href = "/" + e + "/blog.html";
            } else {
                if (d == 2) {
                    location.href = "/" + e + "/expr.html";
                } else {
                    var b = location.href.split("/");
                    if (b[b.length - 1] == "expr.html") {
                        location.href = "/" + e + "/expr.html";
                    } else {
                        location.href = "/" + e + "/";
                    }
                }
            }
        }
    },
    setCookie: function(a, d, c, b, f) {
        c = c || 360;
        f = f || "/";
        b = b ? ";domain=" + b: ";domain=meilele.com";
        var e = new Date();
        e.setTime(e.getTime() + parseInt(c) * 24 * 60 * 60 * 1000);
        document.cookie = a + "=" + encodeURIComponent(d) + (c == "session" ? "": ";expires=" + e.toGMTString()) + b + ";path=" + f;
    },
    getCookie: function(a) {
        var e;
        if (document.cookie && document.cookie != "") {
            var d = document.cookie.split(";");
            var f = d.length;
            for (var c = 0; c < f; c++) {
                var b = d[c].replace(/(^\s*)|(\s*$)/g, "");
                if (b.substring(0, a.length + 1) == (a + "=")) {
                    e = decodeURIComponent(b.substring(a.length + 1));
                    break;
                }
            }
        }
        return e;
    },
    showLoginBox: function(b, a) {
        if (M.getCookie("meilele_login") == "1" && M.getCookie("ECS[username]")) {
            if (typeof b == "function") {
                b();
            }
            return;
        }
        M.showLoginBox.dom = document.getElementById("MLL_login_box");
        if (!M.showLoginBox.dom) {
            M.showLoginBox.dom = document.createElement("div");
            document.body.appendChild(M.showLoginBox.dom);
            M.showLoginBox.dom.className = "MLL_LOGIN_BOX";
            M.showLoginBox.dom.innerHTML = '<div style="text-align:center; padding-top:30px;"><span style="padding:20px;display:inline-block; background:#fff;border:1px solid #ccc;border-radius:5px;">载入中，请稍候...</span></div>';
            M.showLoginBox.dom.setAttribute("id", "MLL_login_box");
            M.showLoginBox.dom.style.width = "400px";
        } else {
            M.showLoginBox.dom.style.display = "block";
        }
        M.showLoginBox.callback = b;
        if (M.showLoginBox.loginScript && window.loginBox) {
            loginBox.dom.style.display = "block";
        } else {
            window._LoginType_ = a;
            M.showLoginBox.loginScript = document.createElement("script");
            M.showLoginBox.loginScript.type = "text/javascript";
            M.showLoginBox.loginScript.src = "http://image.meilele.com/themes/paipai/js/loginbox.min.js?1121";
            setTimeout(function() {
                document.getElementsByTagName("head")[0].appendChild(M.showLoginBox.loginScript);
            },
            0);
        }
    },
    searchSuggest: {
        init: function(c, b) {
            var a = this;
            a.data = a.data || {};
            a.data.obj = c;
            b = b || window.event;
            a.data.event = b;
            a.data.v = c.value;
            a.data.l = document.getElementById("JS_search_suggest");
            if (a.data.show && (b.keyCode == 38 || b.keyCode == 40)) {
                a.data.focusOn = a.data.focusOn || 0;
                a.data.arrow = b.keyCode - 39;
                a.changeFocus();
                return false;
            } else {
                if (a.data.v == "") {
                    a.data.show = false;
                    a.data.l.style.display = "none";
                } else {
                    a.get();
                }
            }
        },
        changeFocus: function() {
            var c = this;
            var b = c.data.focusOn + c.data.arrow;
            if (b >= 0 && b <= c.data.jsonLength + 3) {
                var d = c.data.l.childNodes[b - 1];
                for (var a = 0; a < c.data.l.childNodes.length; a++) {
                    c.data.l.childNodes[a].className = "";
                }
                if (!c.data.focusOn) {
                    c.data.oldValue = c.data.obj.value;
                }
                if (b > 0) {
                    if (d.getAttribute("id") && d.getAttribute("id").indexOf("none") == 0) {
                        c.data.obj.value = c.data.oldValue;
                    } else {
                        c.data.obj.value = d.innerHTML;
                    }
                    d.className = "current";
                }
                if (b == 0) {
                    c.data.obj.value = c.data.oldValue;
                }
                c.data.focusOn = b;
            }
        },
        get: function() {
            var a = this;
            a.data.cache = a.data.cache || {};
            if (a.data.timer) {
                clearTimeout(a.data.timer);
            }
            a.data.timer = setTimeout(function() {
                a.data.v = a.data.obj.value;
                if (a.data.v == "") {
                    return false;
                }
                if (a.data.cache[a.data.v]) {
                    a.response(a.data.cache[a.data.v]);
                } else {
                    if (M.searchSuggest.ajaxHolder) {
                        M.searchSuggest.ajaxHolder.abort();
                    }
                    M.searchSuggest.ajaxHolder = M.ajax({
                        url: "/search_suggest.html?act=search_suggest&k=" + encodeURIComponent(a.data.v),
                        dataType: "json",
                        cache: true,
                        success: function(b) {
                            a.data.cache[a.data.v] = b;
                            a.response(b);
                            M.searchSuggest.ajaxHolder = null;
                        }
                    });
                }
            },
            500);
        },
        response: function(b) {
            var e = this;
            if (b && b.length) {
                e.data.focusOn = 0;
                e.data.jsonLength = b.length;
                var d = "";
                for (var a = 0; a < b.length; a++) {
                    d += '<a href="/keywords/' + b[a].pinyin + '/" target="' + (window._SearchDoNotNewWindow ? "_self": "_blank") + '" onmouseout="this.className=\'\'">' + b[a].keyword + "</a>";
                    if (a == 0) {
                        d += '<a id="none1" href="javascript:;" onclick="M.searchSuggest.getFormAction(0);">在<strong class="red">家具</strong>分类中搜索</a><a id="none2" href="javascript:;" onclick="M.searchSuggest.getFormAction(1);">在<strong class="red">建材</strong>分类中搜索</a><a id="none3" href="javascript:;" onclick="M.searchSuggest.getFormAction(2);">在<strong class="red">家居饰品</strong>分类中搜索</a>';
                    }
                }
                e.data.show = true;
                e.data.l.innerHTML = d;
                e.data.l.style.display = "block";
                if (!e.data.blinkEvent) {
                    var c = document.body;
                    if (c.addEventListener) {
                        c.addEventListener("click",
                        function() {
                            e.hide();
                        },
                        false);
                    } else {
                        if (c.attachEvent) {
                            c.attachEvent("onclick",
                            function() {
                                e.hide();
                            });
                        }
                    }
                    e.data.blinkEvent = true;
                }
            } else {
                e.hide();
            }
        },
        getFormAction: function(a) {
            var b = M.$("#JS_search_form");
            b.action = "/category-9999/mcat0-scat0-b0-max0-min0-st" + a + "-attr-page-1-sort-sort_order-order-asc.html";
            b.setAttribute("target", window._SearchDoNotNewWindow ? "_self": "_blank");
            b.submit();
        },
        hide: function() {
            var a = this;
            a.data.l.style.display = "none";
            a.data.show = false;
        }
    },
    ajax: function(a) {
        var b = this;
        return new b.ajax.prototype.init(a);
    },
    sendSms: function(b, a) {
        return new this.sendSms.prototype.init(b, a);
    },
    orderQuery: function(c, a, b) {
        M.orderQuery.orderSn = c;
        M.orderQuery.phone = a;
        if (b) {
            M.orderQuery.callback = b;
        }
        if (M.orderQuery.loginScript && window.Query) {
            window.Query.show();
        } else {
            M.orderQuery.loginScript = document.createElement("script");
            M.orderQuery.loginScript.type = "text/javascript";
            M.orderQuery.loginScript.src = "http://image.meilele.com/js/mll/order_query.min.js?0905";
            setTimeout(function() {
                document.getElementsByTagName("head")[0].appendChild(M.orderQuery.loginScript);
            },
            0);
            window._queryTmp = setInterval(function() {
                if (window.Query) {
                    window.Query.show();
                    clearTimeout(window._queryTmp);
                }
            },
            500);
        }
    },
    costDownTip: function(a) {
        if (M.costDown) {
            M.costDown.init(a);
        } else {
            M.costDownTip.loginScript = document.createElement("script");
            M.costDownTip.loginScript.type = "text/javascript";
            M.costDownTip.loginScript.src = "http://image.meilele.com/js/mll/costdowntip.min.js?0816";
            setTimeout(function() {
                document.getElementsByTagName("head")[0].appendChild(M.costDownTip.loginScript);
            },
            0);
            M.costDownTip.timer = setInterval(function() {
                if (M.costDown) {
                    M.costDown.init(a);
                    clearTimeout(M.costDownTip.timer);
                }
            },
            100);
        }
    },
    addToCart: function(c, b, d, a) {
        M.showMask();
        if (M.toCart) {
            M.toCart.init(c, b, d, a);
        } else {
            M.addToCart.loginScript = document.createElement("script");
            M.addToCart.loginScript.type = "text/javascript";
            M.addToCart.loginScript.src = "http://image.meilele.com/js/mll/addtocart.min.js?1102";
            setTimeout(function() {
                document.getElementsByTagName("head")[0].appendChild(M.addToCart.loginScript);
            },
            0);
            M.addToCart.timer = setInterval(function() {
                if (M.toCart) {
                    M.toCart.init(c, b, d, a || "");
                    clearTimeout(M.addToCart.timer);
                }
            },
            100);
        }
    },
    comment: function(a, c, b) {
        if (M.comment.commentScript && window.mllComment) {
            window.mllComment.show(a, c);
        } else {
            M.comment.commentScript = document.createElement("script");
            M.comment.commentScript.type = "text/javascript";
            M.comment.commentScript.src = "http://image.meilele.com/js/mll/mll_comment.min.js";
            setTimeout(function() {
                document.getElementsByTagName("head")[0].appendChild(M.comment.commentScript);
            },
            0);
            window._commentTmp = setInterval(function() {
                if (window.mllComment) {
                    window.mllComment.show(a, c);
                    clearTimeout(window._commentTmp);
                }
            },
            100);
        }
        if (typeof b == "function") {
            b();
        }
    }
};
M.ajax.prototype = {
    init: function(c) {
        var f = this;
        f.type = c.type ? c.type.toUpperCase() : "GET";
        f.dataType = c.dataType || "html";
        f.success = c.success || false;
        f.error = c.error || false;
        f.url = c.url || "";
        f.data = c.data || "";
        f.cache = c.cache === false ? false: true;
        f.request = f.getRequest();
        if (M.typeOf(f.data) == "object") {
            var d = "";
            for (var a in f.data) {
                d += "&" + a + "=" + f.data[a];
            }
            if (d) {
                f.data = d.replace("&", "");
            }
            d = null;
        }
        if (f.type == "GET") {
            var g = (f.url.indexOf("?") > -1) ? "&": "?";
            f.url += f.data ? (g + f.data) : "";
        }
        if (!f.cache) {
            var b = new Date();
            b = b.getTime();
            var g = (f.url.indexOf("?") > -1) ? "&": "?";
            f.url += g + "_=" + b;
        }
        if (f.request) {
            var e = f.request;
            e.onreadystatechange = f.bindFunction(f.stateChange, f);
            e.open(f.type, f.url, true);
            if (f.type == "POST") {
                e.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
                e.send(f.data);
            } else {
                e.send(null);
            }
        }
    },
    getRequest: function() {
        if (window.ActiveXObject) {
            return new ActiveXObject("Microsoft.XMLHTTP");
        } else {
            if (window.XMLHttpRequest) {
                return new XMLHttpRequest();
            }
        }
        return false;
    },
    bindFunction: function(b, a) {
        return function() {
            return b.apply(a, [a]);
        };
    },
    stateChange: function(object) {
        that = this;
        if (that.request.readyState == 4) {
            if (that.request.status == 200) {
                if (that.dataType == "json") {
                    try {
                        if (typeof JSON === "object") {
                            var json = JSON.parse(that.request.responseText);
                        } else {
                            var json = eval("(" + that.request.responseText + ")");
                        }
                    } catch(e) {
                        if (that.error) {
                            that.error();
                            return false;
                        }
                    }
                    if (typeof json === "object") {
                        if (that.success) {
                            that.success(json, that.request.status, that.request);
                            return true;
                        }
                    } else {
                        if (that.error) {
                            that.error();
                            return false;
                        }
                    }
                } else {
                    if (that.success) {
                        that.success(that.request.responseText, that.request.status, that.request);
                        return true;
                    }
                }
            } else {
                if (that.error) {
                    that.error(that.request);
                    return false;
                }
            }
        }
    }
};
M.ajax.prototype.init.prototype = M.ajax.prototype;
M.sendSms.prototype = {
    constructor: M.sendSms,
    init: function(b, a) {
        if (!b) {
            return;
        }
        if (M._currentSendSmsBox) {
            M._currentSendSmsBox.remove();
        }
        this.setting = M.extend({
            type: "exprAddress",
            phoneNumber: false,
            autoSend: false,
            autoClose: true
        },
        a);
        this.exprId = b;
        this.dom = this.show();
        M._currentSendSmsBox = this;
        this.msgBox = M.$("#_JS_sndSms_msg_box_");
        this.inpt = M.$("#_JS_sndSms_input_");
        this.btn = M.$("#_JS_sndSms_btn_");
        if (this.setting.phoneNumber && this.setting.autoSend) {
            this.send();
        }
    },
    show: function() {
        var b = "http://image.meilele.com/images/sendsms.gif";
        var a = "请输入您的手机号";
        return M.lightBox('<div style="width:300px;padding-bottom:20px;border:1px solid #c1bfc0;box-shadow:1px 1px 1px efefef;background:#fff;margin:0px auto;"><div style="background:url('../阿里商城_files/ + b + ') 0px 0px repeat-x;height:22px;padding-right:10px;padding-top:8px;border-bottom:1px solid #f2f2f2" class="r"><a href="javascript:;" onclick="M._currentSendSmsBox.remove();return !1;"><span style="display:inline-block;background:url('../阿里商城_files/ + b + ') 0px -60px no-repeat;width:14px;height:14px;vertical-align:top;margin-right:3px;"></span>关闭</a></div><div style="padding-top:27px;padding-left:20px;" class="' + (this.setting.phoneNumber ? "none": "") + '"><input style="width:170px;height:28px;border:1px solid #c7c7c7;padding:0;margin:0;vertical-align:top;color:#555;padding-left:5px;line-height:28px;" value="' + (this.setting.phoneNumber || a) + '" onfocus="if(this.value==\'' + a + '\')this.value=\'\'"  onkeypress="M._currentSendSmsBox.keyPress(event);" id="_JS_sndSms_input_" /><input id="_JS_sndSms_btn_" type="button" style="height:30px;background:url('../阿里商城_files/ + b + ') 0px -30px;width:71px;color:#fff;text-align:center;border:none;margin:0;padding:0;vertical-align:top;margin-left:5px;" class="pointer" onclick="M._currentSendSmsBox.send();" value="免费发送" /></div><div style="color:#454545;padding:20px;padding-bottom:0px;" id="_JS_sndSms_msg_box_"></div></div>', {},
        true);
    },
    remove: function() {
        if (M._currentSendSmsBox && M._currentSendSmsBox.dom) {
            document.body.removeChild(M._currentSendSmsBox.dom);
            M._currentSendSmsBox = null;
        }
    },
    send: function() {
        var a = parseInt(M._currentSendSmsBox.inpt.value.replace(/\D/g, ""));
        M._currentSendSmsBox.inpt.value = a || "";
        if (!a) {
            M._currentSendSmsBox.msg("请输入正确手机号码。");
            return;
        }
        M._currentSendSmsBox.msg("发送中...");
        M._currentSendSmsBox.btn.disabled = true;
        M.ajax({
            url: "/ajax_ajax.html?act=send_expr_message&expr_id=" + M._currentSendSmsBox.exprId + "&mobile=" + a,
            data: M._currentSendSmsBox.setting,
            type: "get",
            dataType: "json",
            success: function(b) {
                if (b.error == "0") {
                    if (M._currentSendSmsBox.setting.autoClose) {
                        b.msg += "<br />本窗口将在2秒后自动关闭。";
                        setTimeout(M._currentSendSmsBox.remove, 4000);
                    }
                    M._currentSendSmsBox.msg(b.msg, true);
                    if (M._currentSendSmsBox.setting.success) {
                        M._currentSendSmsBox.setting.success(b);
                    }
                } else {
                    M._currentSendSmsBox.msg(b.msg);
                    M._currentSendSmsBox.btn.disabled = false;
                }
            },
            error: function() {
                M._currentSendSmsBox.msg("发送失败");
                M._currentSendSmsBox.btn.disabled = false;
            }
        });
    },
    msg: function(b, c) {
        var a = c ? "-14": "-32";
        b = '<span style="display:inline-block;vertical-align:middle;width:18px;height:18px;background:url(http://image.meilele.com/images/sendsms.gif) ' + a + 'px -60px;margin-right:3px;"></span><span style="vertical-align:middle">' + b + "</span>";
        M._currentSendSmsBox.msgBox.innerHTML = b;
    },
    keyPress: function(a) {
        a = a || window.event;
        if (a.keyCode == 13) {
            M._currentSendSmsBox.send();
        }
    }
};
M.sendSms.prototype.init.prototype = M.sendSms.prototype;
function MLLBanner(lists, setting) {
    if (! (lists && lists.length)) {
        return false;
    }
    var banner = [],
    doc = document,
    tmpId = (new Date()).getTime().toString(36),
    length = lists.length,
    now,
    next,
    over,
    outStep,
    inStep,
    countList = [],
    focus = true,
    must = false;
    var defaultSetting = {
        width: 980,
        height: 60,
        domId: "JS_banner",
        delay: 6000,
        inTimer: 600,
        outTimer: 300,
        stepTimer: 40
    };
    var timeDefaultSetting = {
        content: "$D天 $H:$I:$S",
        style_position: "absolute",
        "style_margin-left": "600px",
        "style_margin-top": "15px",
        "style_font-size:": "16px"
    };
    setting = mergeSetting(defaultSetting, setting);
    var bannerDom = doc.getElementById(setting.domId);
    if (!bannerDom) {
        return false;
    }
    bannerDom.style.display = "block";
    outStep = 100 / (setting.outTimer / setting.stepTimer);
    inStep = 100 / (setting.inTimer / setting.stepTimer);
    var Banner = function(info, key) {
        this.info = info || [];
        this.key = key;
        this.opacity = 0;
        this.createHTML();
    };
    Banner.prototype = {
        createHTML: function() {
            this.html = '<div id="JS_banner_box_' + this.key + "_" + tmpId + '" style="display:none;position:absolute;background:url(http://image.meilele.com/themes/paipai/images/loading.gif) center center no-repeat;filter:alpha(opacity=100);">';
            if (this.info[3]) {
                try {
                    eval("this.info[3]=" + this.info[3]);
                } catch(e) {}
                if (this.info[3] && typeof this.info[3] == "object" && this.info[3].endTime) {
                    this.timeSetting = mergeSetting(timeDefaultSetting, this.info[3]);
                    this.timeSetting.timeLeft = toSecond(this.timeSetting.endTime) - (new Date()).getTime();
                    countList.push([this.key, this.timeSetting]);
                    this.html += '<div style="' + styleToString(this.timeSetting) + '" id="JS_banner_time_' + this.key + "_" + tmpId + '"></div>';
                }
            }
            this.html += '<a id="JS_banner_link_' + this.key + "_" + tmpId + '" href="' + (this.info[1] || "/") + '" title="' + (this.info[2] || "") + '" target="_blank"><img id="JS_banner_img_' + this.key + "_" + tmpId + '" src="' + this.info[0] + '" width="' + setting.width + 'px" height="' + setting.height + 'px"></a>';
            this.html += "</div>";
        },
        changeOpacity: function(to) {
            if (this.box.filters) {
                this.box.filters.alpha.opacity = to;
            } else {
                this.box.style.opacity = to / 100;
            }
            if (to <= 0) {
                this.box.style.display = "none";
            } else {
                this.box.style.display = "block";
            }
            this.opacity = to;
        }
    };
    function mergeSetting(defaultSetting, setting) {
        setting = setting || {};
        for (var k in defaultSetting) {
            if (setting[k] === undefined) {
                setting[k] = defaultSetting[k];
            }
        }
        return setting;
    }
    function switchBanner() {
        if (over && !must) {
            return;
        }
        if (!focus && !must) {
            return;
        }
        next = (now + 1) % length;
        if (banner[now].opacity > 0) {
            banner[now].changeOpacity(banner[now].opacity - outStep);
            must = true;
            setTimeout(switchBanner, setting.stepTimer);
        } else {
            if (banner[next].opacity < 100) {
                banner[next].changeOpacity(banner[next].opacity + outStep);
                must = true;
                setTimeout(switchBanner, setting.stepTimer);
            } else {
                must = false;
                now = next;
            }
        }
    }
    function styleToString(style) {
        var r = [];
        for (var key in style) {
            if (key.indexOf("style_") === 0) {
                r.push(key.replace("style_", "") + ":" + style[key]);
            }
        }
        return r.join(";");
    }
    function toSecond(string) {
        var t = string.split("-");
        var d = new Date(t[0], parseInt(t[1]) - 1, t[2]);
        return d.getTime();
    }
    function count() {
        for (var k = 0,
        kk = countList.length; k < kk; k++) {
            var c = countList[k];
            if (c && banner[c[0]] && banner[c[0]].time) {
                var dom = banner[c[0]].time;
                c[1].timeLeft -= 1000;
                if (c[1].timeLeft <= 0) {
                    c[1].timeLeft = 0;
                }
                dom.innerHTML = fixTime(c[1]);
            }
        }
    }
    function fixTime(time) {
        var sec = parseInt(time.timeLeft / 1000);
        if (sec < 0) {
            sec = 0;
        }
        var s = sec % 60;
        if (s < 10) {
            s = "0" + s;
        }
        var m = parseInt(sec % 3600 / 60);
        if (m < 10) {
            m = "0" + m;
        }
        var h = parseInt(sec % (3600 * 24) / 3600);
        if (h < 10) {
            h = "0" + h;
        }
        var d = parseInt(sec / (3600 * 24));
        if (time.content.indexOf("$D") < 0) {
            h = (d * 24) - 0 + (h - 0);
        }
        return time.content.replace("$D", d).replace("$H", h).replace("$I", m).replace("$S", s);
    }
    var h = "";
    for (var k = 0,
    kk = length; k < kk; k++) {
        banner[k] = new Banner(lists[k], k);
        h += banner[k].html;
    }
    bannerDom.innerHTML = h;
    bannerDom.onmouseover = function() {
        over = true;
    };
    bannerDom.onmouseout = function() {
        over = false;
    };
    for (var k = 0,
    kk = length; k < kk; k++) {
        banner[k].box = doc.getElementById("JS_banner_box_" + k + "_" + tmpId);
        banner[k].link = doc.getElementById("JS_banner_link_" + k + "_" + tmpId);
        banner[k].img = doc.getElementById("JS_banner_img_" + k + "_" + tmpId);
        banner[k].time = doc.getElementById("JS_banner_time_" + k + "_" + tmpId);
        if (!k) {
            banner[k].opacity = 100;
            banner[k].box.style.display = "block";
            now = k;
        }
    }
    if (countList.length) {
        setInterval(count, 1000);
    }
    if (length > 1) {
        setInterval(switchBanner, setting.delay);
    }
} (function(d, c, f) {
    f = f || {};
    var e, a = document.body,
    b = c.getElementsByTagName("head")[0];
    f.typeOf = function(g) {
        var h = typeof g;
        if (h == "object" && h != "string" && g && g.length) {
            h = "array";
        }
        return h;
    };
    f.extend = function(i, h) {
        i = i || {};
        h = h || {};
        for (var g in h) {
            i[g] = h[g];
        }
        return i;
    };
    f.addHandler = function(k, j, i, h) {
        function g(m) {
            var l = m ? m: window.event;
            l.target = m.target || m.srcElement;
            return i.apply(h || this, arguments);
        }
        k.eventHash = k.eventHash || {}; (k.eventHash[j] = k.eventHash[j] || []).push({
            name: j,
            handler: i,
            fn: g,
            scope: h
        });
        if (k.addEventListener) {
            k.addEventListener(j, g, false);
        } else {
            if (k.attachEvent) {
                k.attachEvent("on" + j, g);
            } else {
                k["on" + j] = g;
            }
        }
    };
    f.removeHandler = function(m, l, k, j) {
        m.eventHash = m.eventHash || {};
        var i = m.eventHash[l] || [],
        h = i.length;
        if (h > 0) {
            for (; h--;) {
                var g = i[h];
                if (g.name == l && g.handler === k && g.scope === j) {
                    if (m.removeEventListener) {
                        m.removeEventListener(l, g.fn, false);
                    } else {
                        if (m.detachEvent) {
                            m.detachEvent("on" + l, g.fn);
                        } else {
                            m["on" + l] = null;
                        }
                    }
                    i.splice(h, 1);
                    break;
                }
            }
        }
    };
    f.inArray = function(j, l) {
        var h = -1;
        if (j && l && l.length) {
            for (var g = 0,
            i = l.length; g < i; g++) {
                if (j == l[g]) {
                    return g;
                }
            }
        }
        return h;
    };
    f.$ = function(g, j) {
        if (!g) {
            return false;
        }
        if (j === e) {
            j = document;
        }
        if (f.typeOf(j) === "string") {
            j = f.$(j);
        }
        if (!j) {
            return false;
        }
        if (g.indexOf("#") == 0) {
            var m = document.getElementById(g.substr(1));
        } else {
            if (g.indexOf(".") == 0) {
                if (j.getElementsByClassName && 0) {
                    var m = j.getElementsByClassName(g.replace(".", ""));
                } else {
                    var m = [],
                    k = j.getElementsByTagName("*");
                    for (var h = 0; h < k.length; h++) {
                        var l = k[h];
                        var n = l.className;
                        if (n) {
                            n = n.split(/\s/g);
                            if (f.inArray(g.replace(".", ""), n) >= 0) {
                                m.push(l);
                            }
                        }
                    }
                }
            } else {
                var m = j.getElementsByTagName(g);
            }
        }
        return m;
    };
    f.addClass = function(g, h) {
        if (g) {
            var i = (g.className + "").split(/\s/g) || [];
            if (f.inArray(h, i) == -1) {
                i.push(h);
                g.className = i.join(" ");
            }
        }
        return g;
    };
    f.removeClass = function(l, m) {
        if (m && typeof m == "string" && l && typeof l.className == "string") {
            var h = l.className.split(/\s/g);
            var i = [];
            if (h && h.length) {
                for (var g = 0,
                j = h.length; g < j; g++) {
                    if (h[g] != m) {
                        i.push(h[g]);
                    }
                }
            }
            l.className = i.join(" ");
        }
        return l;
    };
    f.bindFunction = function(i, g) {
        var h = Array.prototype.slice.call(arguments).slice(2);
        return function() {
            return g.apply(i, h.concat(Array.prototype.slice.call(arguments)));
        };
    };
})(window, document, window.M);
window.requestAnimFrame = (function() {
    return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||
    function(b, a) {
        window.setTimeout(b, 1000 / 60);
    };
})();
M.Animate = function(c, a, b, e, d) {
    return new M.Animate.prototype.init(c, a, b, e, d);
};
M.Animate.prototype = {
    init: function(d, b, c, f, e) {
        this.dom = d;
        this.time = c || 300;
        this.preTime = 10;
        this.list = b;
        this.callback = e;
        this.tweenType = f || "easeInOut";
        this._d = Math.ceil(this.time / this.preTime);
        this._t = 0;
        this._c = {};
        this._b = {};
        for (var a in this.list) {
            this._b[a] = parseFloat(this.currentStyle()[a]) || 0;
            this._c[a] = parseFloat(this.list[a]) - this._b[a];
        }
        if (this.dom._animate) {
            this.dom._animate.stop();
        }
        this.run();
        this.dom._animate = this;
    },
    currentStyle: function() {
        var a = this.dom;
        return a.currentStyle || document.defaultView.getComputedStyle(a, null);
    },
    run: function() {
        if (this._t > this._d) {
            if (M.typeOf(this.callback) == "function") {
                this.callback();
            }
            return;
        } else {
            if (this._stop) {
                return;
            } else {
                for (var a in this.list) {
                    var b = this.tween[this.tweenType](this._t, this._b[a], this._c[a], this._d) + (("opacity|".indexOf(a + "|") > -1) ? "": "px");
                    this.dom.style[a] = b;
                }
                this._t++;
                requestAnimFrame(M.bindFunction(this, this.run), this.preTime);
            }
        }
    },
    stop: function() {
        this._stop = true;
    },
    tween: {
        easeIn: function(e, a, g, f) {
            return g * (e /= f) * e * e * e + a;
        },
        easeOut: function(e, a, g, f) {
            return - g * ((e = e / f - 1) * e * e * e - 1) + a;
        },
        easeInOut: function(e, a, g, f) {
            if ((e /= f / 2) < 1) {
                return g / 2 * e * e * e * e + a;
            }
            return - g / 2 * ((e -= 2) * e * e * e - 2) + a;
        },
        linear: function(e, a, g, f) {
            return g * e / f + a;
        }
    }
};
M.Animate.prototype.init.prototype = M.Animate.prototype;
var taobao = 1;
function static_dynamic(page_sn) {
    var dom = document.getElementById("static_dynamic");
    if (!dom) {
        return;
    }
    var page_sn = dom.getAttribute("page_sn");
    if (typeof page_sn == "undefined" || !page_sn || page_sn.length == 0) {
        var href = location.href;
        if (href.substr( - 4) == ".com" || href.substr( - 4) == "com/") {
            page_sn = "index";

        } else {
            if (href.indexOf("category-") != -1) {
                if (href.indexOf("goods-") > href.indexOf("category-")) {
                    page_sn = "goods";
                } else {
                    page_sn = "category";
                }
            } else {
                if (href.indexOf("article_cat") != -1) {
                    if (href.indexOf("article-") > href.indexOf("article_cat")) {
                        page_sn = "article";
                    } else {
                        page_sn = "article_cat";
                    }
                }
            }
        }
    }
    var url = "/ajax_static_dynamic/?nojs&page_sn=" + page_sn;
    goods_id = dom.getAttribute("goods_id");
    rgn_id = dom.getAttribute("rgn_id");
    debug = dom.getAttribute("debug");
    if (typeof goods_id != "undefined" && goods_id && goods_id > 0) {
        url = url + "&goods_id=" + goods_id;
    }
    if (typeof rgn_id != "undefined" && rgn_id && rgn_id > 0) {
        url = url + "&rgn_id=" + rgn_id;
    }
    if (typeof debug != "undefined" && debug && debug > 0) {
        url = url + "&debug=1";
    }
    M.ajax({
        url: url,
        dataType: "json",
        data: window._STATIC_DATA_ || null,
        cache: false,
        success: function(json) {
            var tmp = {};
            for (var k in json) {
                var callback = null;
                var key = json[k].node_name;
                if (key) {
                    tmp[key] = json[k];
                }
                if (json[k].node_name && json[k].html_content.toString().length && document.getElementById(json[k].node_name)) {
                    document.getElementById(json[k].node_name).innerHTML = json[k].html_content;
                }
                if (json[k].js_call_func_name) {
                    try {
                        var callback = eval(json[k].js_call_func_name);
                    } catch(e) {}
                    if (callback && typeof callback == "function") {
                        callback(json[k]);
                    }
                }
            }
            if (window._STATIC_DYNAMIC_CALLBACK && typeof window._STATIC_DYNAMIC_CALLBACK == "function") {
                window._STATIC_DYNAMIC_CALLBACK(tmp);
            }
        }
    });
    return true;
}
function _INIT_HEAD_PHONE_SCROLL_() {
    var a = document.getElementById("JS_header_phone");
    if (!a) {
        return;
    }
    a.innerHTML += "<br>" + a.innerHTML;
    _HEAD_PHONE_SCROLL_();
}
function _HEAD_PHONE_SCROLL_() {
    var c = document.getElementById("JS_header_phone");
    if (!c) {
        return;
    }
    var b = 30;
    var d = c.innerHTML.toLowerCase().split(/\<br\s?\/?\>/g).length;
    var a = (parseInt(c.style.marginTop) || 0) - 1;
    if (a < 0 - b * d / 2) {
        a = -1;
    }
    c.style.marginTop = a + "px";
    if (a % b) {
        setTimeout(_HEAD_PHONE_SCROLL_, 30);
    } else {
        setTimeout(_HEAD_PHONE_SCROLL_, 5000);
    }
}